<template>
  <div style="height:100%; display: flex; gap: 1px; align-items: center;">
    <ElButton link type="primary" @click="addHandler">
      <ElIcon>
        <Plus />
      </ElIcon>
      添加
    </ElButton>
    <ElButton link type="warning" @click="editorHandler">
      <ElIcon>
        <Edit />
      </ElIcon>
      修改
    </ElButton>
    <ElButton link type="danger" @click="deleteHandler">
      <ElIcon>
        <Delete />
      </ElIcon>
      删除
    </ElButton>
  </div>
</template>

<script setup lang='ts'>
import type { ICellRendererParams } from 'ag-grid-enterprise';
import type { IOlympicData } from '@/views/types'

const props = defineProps<{
  params: ICellRendererParams<IOlympicData>
}>()

const addHandler = () => {
  console.log('addHandler', props.params.data);
}
const editorHandler = () => {
  console.log('editorHandler', props.params.data);
}
const deleteHandler = () => {
  console.log('deleteHandler', props.params.data);
}
</script>

<style scoped></style>
